@import '@/styles/variables.scss';
// 全局样式
// @import './variables.scss'; // 已经在vue.config.js sass-loader中引入

// html,
// body {
//     font-family: Helvetica, 'Microsoft YaHei';
// }

/* 设置打印页面时的外边距 START */
/* 代码来自 npm react-to-print */
@page {
    size: auto;
    margin: 0mm;
}
@media print {
    /* 设置打印页面时的外边距 END */
    body {
        -webkit-print-color-adjust: exact;
    }
    .scrollbar-style::-webkit-scrollbar {
        width: 8px;
    }
    .scrollbar-style::-webkit-scrollbar-track {
        border-radius: 10px;
        background-color: transparent;
    }
    .scrollbar-style::-webkit-scrollbar-thumb {
        border-radius: 5px;
        background-color: rgba(150, 150, 150, 0.66);
        border: 4px solid rgba(150, 150, 150, 0.66);
        background-clip: content-box;
    }
    .v-modal,
    #app {
        display: none !important;
    }
    .el-dialog {
        // 去掉dialog shadow
        box-shadow: none !important;
    }
    .el-dialog__wrapper {
        position: unset !important;
        height: auto !important;
        overflow: unset !important;
    }
}

html,
body,
#app {
    height: 100%;
    // min-height: 400px;
    // background-color: $--color-fill;
    font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;
}

// element-ui table 线不对齐问题: https://juejin.im/post/6889038698772430862
.el-table th.gutter {
    display: table-cell !important;
}

a {
    text-decoration: none;
}
.zindex110 {
    z-index: 110;
}

.zindex111 {
    z-index: 111;
}

.is-focus {
    color: $--color-button-focus;
    border-color: $--color-border-button-focus;
    background-color: $--color-bg-button-focus;
}

.is-info {
    color: $--color-success;
}
.is-danger {
    color: $--color-danger;
}
.is-success {
    color: $--color-info;
}

.bill-outstanding,
.bill-finish,
.bill-overdue {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 12px;
}
.bill-outstanding {
    background-color: $--color-success;
}
.bill-finish {
    background-color: $--color-info;
}
.bill-overdue {
    background-color: $--color-danger;
}

#app {
    .tio {
        padding-left: 20px;
        padding-top: 20px;
        text-align: left;
        color: $--color-text-dark;
        ul > li > h1 {
            font-size: 18px;
            font-weight: bold;
        }
        ul > li {
            font-size: 14px;
            padding-bottom: 10px;
            box-sizing: border-box;
        }
    }
    .list-head {
        display: flex;
        align-items: center;
        padding-bottom: 20px;
        &.is-mobile {
            padding-bottom: 0;
            flex-flow: column nowrap;
            align-items: flex-start;
            .list-head-item {
                margin-bottom: 10px;
            }
        }
        .list-head-item {
            margin-right: $--font-size-14;
            font-size: $--font-size-14;
            .subtitle {
                color: $--color-text-sub;
            }
            .dark {
                color: $--color-text-dark;
            }
        }
    }

    .main-container {
        // padding-top: $--nabbar-height;
        transition: margin-left 0.28s; // 点击展开或收起时的动画
        margin-left: $sideBarWidth;
        height: inherit;
        position: relative;
        background-color: $--color-fill;
    }
    .sidebar-container {
        transition: width 0.28s; // 点击展开或收起时的动画
        width: $sideBarWidth;
        // min-height: 100%;
        // overflow: hidden;
        position: fixed;
        // position: absolute;
        left: 0;
        bottom: 0;
        top: $--nabbar-height;
        // z-index: 2;
        background-color: $menuBg;
        box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.15);

        // S reset element-ui css
        .horizontal-collapse-transition {
            transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
        }
        // E reset element-ui css
        .scrollbar-wrapper {
            overflow-x: hidden !important;
        }

        .el-scrollbar__bar.is-vertical {
            right: 0px;
        }

        .el-scrollbar {
            height: 100%;
        }

        &.has-hamburger {
            .el-scrollbar {
                // height: calc(100% - 64px - 28px);
                // height: calc(100% - $--height-hamburger);
                height: calc(100% - 64px - 28px);
            }
        }

        /* a 标签默认有下划线bug */
        .color {
            text-decoration: none;
        }
        // 自定义字体
        .iconfont {
            margin-right: 17px;
            color: $menuText;
        }
        .el-menu {
            border: none;
        }
        .el-menu-vertical-demo:not(.el-menu--collapse) {
            width: $sideBarWidth;
            // min-height: 400px;
        }
        .el-menu-vertical-demo {
            width: 35px;
        }
        .el-submenu .el-menu-item {
            min-width: $sideBarWidth;
        }
        // 仅有一级标题
        .el-menu-item.is-active {
            background-color: $menuActiveBg !important;
            border-right: 2px solid $--color-primary;
            // 自定义字体active时的颜色
            .iconfont {
                // color: $menuActiveText;
                color: inherit;
            }
        }
        // 有二级级标题
        .el-submenu.is-active {
            // background-color: $menuActiveBg !important;
            // 自定义字体active时的颜色
            .iconfont {
                // color: $subMenuActiveText;
                color: inherit;
            }
        }

        // menu hover
        .el-menu-item,
        .el-submenu__title {
            &:hover {
                background-color: $menuHover !important;
            }
        }
        .is-active > .el-submenu__title {
            color: $subMenuActiveText !important;
        }

        & .nest-menu .el-submenu > .el-submenu__title,
        & .el-submenu .el-menu-item {
            min-width: $sideBarWidth !important;
            background-color: $subMenuBg;

            &:hover {
                background-color: $subMenuHover !important;
            }
        }
    }

    /* S 隐藏左侧菜单树 */
    .hideSidebar,
    .isCloseMenu {
        .sidebar-container {
            width: 54px !important;
        }
        .el-menu-item,
        .el-submenu {
            box-sizing: border-box;
            width: 54px !important;
        }
        .main-container {
            margin-left: 54px;
        }
        // 有二级级标题
        .el-submenu.is-active {
            border-right: 2px solid $--color-primary;
            // 自定义字体active时的颜色
            .iconfont {
                color: $menuActiveText;
            }
        }

        // .svg-icon {
        //     margin-right: 0px;
        // }

        // .submenu-title-noDropdown {
        //     padding: 0 !important;
        //     position: relative;

        //     .el-tooltip {
        //         padding: 0 !important;

        //         .svg-icon {
        //             margin-left: 20px;
        //         }
        //     }
        // }

        // .el-submenu {
        //     overflow: hidden;

        //     & > .el-submenu__title {
        //         padding: 0 !important;

        //         .svg-icon {
        //             margin-left: 20px;
        //         }

        //         .el-submenu__icon-arrow {
        //             display: none;
        //         }
        //     }
        // }

        .el-menu--collapse {
            .el-submenu {
                & > .el-submenu__title {
                    & > span {
                        height: 0;
                        width: 0;
                        overflow: hidden;
                        visibility: hidden;
                        display: inline-block;
                    }
                }
            }
        }
    }
    /* E 隐藏左侧菜单树 */

    .isMobile,
    .isCloseMenu {
        .sidebar-container {
            top: 40px;
            &.has-hamburger {
                .el-scrollbar {
                    // height: calc(100% - 64px - 28px);
                    // height: calc(100% - $--height-hamburger);
                    height: calc(100% - 44px - 28px);
                }
            }
        }
        .main-container {
            margin-left: 0px;
        }
    }
    .isMobile {
        &.el-header {
            height: 40px !important;
            .navbar {
                height: 40px;
                line-height: 40px;
            }
        }
    }
}

.table-line-clamp {
    .cell {
        text-overflow: -o-ellipsis-lastline;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        -webkit-box-orient: vertical;
    }
}

.form-the-datepicker {
    .el-input__inner {
        padding-left: 15px;
        padding-right: 15px;
    }
}
.search-wrap {
    display: flex;
    flex-flow: row wrap;
    .search-item.left {
        min-width: 455px;
    }
}

.custom-the-datepicker,
.custom-the-select_time,
.custom-the-select_key {
    .el-input__inner {
        padding-left: 10px;
        padding-right: 10px;
    }
}

.image-wrapper {
    display: flex;
    flex-flow: row wrap;
    .image-item {
        min-height: 100px;
        max-height: 200px;
        max-width: 100%;
        img {
            max-width: inherit;
            max-height: inherit;
        }
    }
}
